vignettes/3_cell_clustering.Rmd
3_cell_clustering.RmdWe also provide an alternative way to cluster cells based on hierarchical clustering. The tree is cut using the DynamicTreeCut R package.
# Perform hierarchical cluster algorithm and cut the tree using DynamicTreeCut package
pbmc_scigenex <- cell_clust(pbmc_scigenex, min_cluster_size = 4)## ..cutHeight not given, setting it to 1.12 ===> 99% of the (truncated) height range in dendro.
## ..done.
You can visualize your clustering result with the plot_heatmap function using all the cells… …or the core cells of each cluster provided by DynamicTreeCut.
# Heatmap of the top genes for each pattern of co-expressed genes
plot_heatmap(pbmc_scigenex,
use_top_genes = TRUE,
cell_order = names(sort(pbmc_scigenex@cell_clusters$labels)),
line_size = 2)## |-- Centering matrix.
## |-- Ordering cells.
## |-- Ceiling matrix.
## |-- Flooring matrix.
## |-- Plotting heatmap.